package com.app.miwawa.api.esm.entity.customer;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.framework.common.api.entity.CommonEntityUUID;
import org.framework.common.api.support.annotation.Chosen;
import org.framework.common.api.support.annotation.ChosenType;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 学员信息表
 * <p>描述: 客户资料</p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date 2016年1月23日 下午11:18:55
 * @version 1.0.2016
 */
@Entity @Table(name = "TB_ESM_CUSTOMER_STUDENT")
public class Student extends CommonEntityUUID {

	/** serialVersionUID(long):. */
	private static final long serialVersionUID = -9072273710374900976L;

	// 性别
	@Column(name = "sex", length = 5, nullable = true)
	private String sex;
	
	// 姓名
	@Column(name = "name", length = 50, nullable = true)
	private String name;
	
	// 昵称
	@Column(name = "nick", length = 50, nullable = true)
	private String nick;
	
	// 备注
	@Column(name = "remark", length = 50, nullable = true)
	private String remark;
	
	// 宝宝头像
	@Lob @Basic(fetch=FetchType.LAZY)
	@Column(name = "avatar", nullable = true)
	private String avatar;
		
	// 生日
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name = "birthday", nullable = true)
	private Date birthday;

	// 客户资料ID
	@Column(name = "customer_id", length = 50, nullable = true)
	private String customerId;
		
	@Override
	@Chosen(type=ChosenType.VALUE)
	public String getId() {
		// TODO Auto-generated method stub
		return super.getId();
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Chosen(type=ChosenType.TEXT)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNick() {
		return nick;
	}

	public void setNick(String nick) {
		this.nick = nick;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}
	
}
